<!-- support mediagoblin -->
<script src="/js/extlib/jquery/jquery-1.8.2.min.js"></script>

<script>
$(document).ready(function(){
  var cpid    = 8;
  var jsonvar = eval('jsondata' + cpid);
  var goal = jsonvar.money_target;
  var moneyRaised = jsonvar.money_raised_percentage;
  var percentWidth = moneyRaised.split('%')[0];
  var daysleft = Math.ceil((new Date(2012, 10, 9) - new Date()) / (1000 * 60 * 60 * 24));
  if ( percentWidth > 100 ) {
      moneyRaised = '100%';
  }

  if ( percentWidth == 0) {
    $(".campaign_counter_bar").animate({width: "0.5%"}, 1000);
  } else {
    $(".campaign_counter_bar").animate({width: moneyRaised}, 1000);
  }

  $("#raised_percentage").html(moneyRaised);
  $("#raised_info").html(jsonvar.money_raised);
  if ( daysleft == 1) {
    $("#daysleft").html("Only 1 day left!");
  } else if ( daysleft == 0 ) {
    $("#daysleft").html("Last day to donate!");
  } else if (daysleft > 0 ) {
    $("#daysleft").html("Only " + daysleft + " days left!");
  } else {
    $("#daysleft").html("0 days left!");
  }
});
</script>

<script type="text/javascript"
        src="https://crm.fsf.org/sites/all/modules/civicrm//extern/widget.php?cpageId=8&widgetId=7&format=3"></script>

<div class="grid_16 alpha omega campaign_counter_container">
  <a href="/pages/campaign.html"><div class="campaign_counter"><div class="campaign_counter_bar"></div><p><span id="raised_info">Raised $ of $ 60,000.00</span></p></div></a>
  <p>
    ... that's <span id="raised_percentage">0%</span>!
    <span id="daysleft"></span>
Support MediaGoblin!
  </p>
</div>
<div class="clear"></div>
<!-- support mediagoblin -->
